#ifndef HASIO_DETAIL_REACTIVE_SOCKET_SEND_OP_HPP
#define HASIO_DETAIL_REACTIVE_SOCKET_SEND_OP_HPP

#if defined(_MSC_VER) && (_MSC_VER >= 1200)
# pragma once
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200

#include "reactor_op.hpp"
#include "socket_ops.hpp"

namespace hasio {
namespace detail {

template <typename ConstBufferSequence>
class reactive_socket_send_op_base
    : public reactor_op
{
public:
    reactive_socket_send_op_base(socket_type fd, const ConstBufferSequence &buffers,
        func_type complete_func, const hasio::error_code &ec)
        : reactor_op(&reactive_socket_send_op_base::do_perform, complete_func, ec)
        , fd_(fd)
        , buffers_(buffers)
    {
    }

    static status do_perform(reactor_op* base)
    {
        reactive_socket_send_op_base* op
            = static_cast<reactive_socket_send_op_base>(base);
        //socket_ops::send(op->fd_, op->buffers_)

        return status::done;
    }
private:
    socket_type fd_;
    ConstBufferSequence buffers_;
};

}
}

#endif // HASIO_DETAIL_REACTIVE_SOCKET_SEND_OP_HPP 